import React from 'react'

const Collist = ({plants,cancelCollection}) => {
  return (
    <ul className='collist'>
        {
            plants.map(item=>{
              if(item.isCollect){
                return(
                  <div key={item.plantID}>
                      <li>{item.name}</li>
                      <button onClick={()=>{cancelCollection(item.plantID)}}>取消收藏</button>
                  </div>
                )
              }
            })
        }
    </ul>
  )
}

export default Collist